package com.sunnay.controller;

import com.sunnay.service.AutoDeliveryOrderService;
import com.sunnay.service.AutoFaceOrderService;
import com.sunnay.util.R;
import com.sunnay.web.ContextHelper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/common")
public class CommonController {

    @Resource
    private AutoFaceOrderService faceOrderService;

    @Resource
    private AutoDeliveryOrderService deliveryOrderService;

    //当面交易
    @GetMapping("/submit-face")
    public R<Boolean> submitFace() {
        faceOrderService.submitFace(ContextHelper.getSystemUser());
        return R.ok();
    }

    //确认收货
    @GetMapping("/submit-receive")
    public R<Boolean> submitReceive() {
        deliveryOrderService.submitReceive(ContextHelper.getSystemUser());
        return R.ok();
    }
}
